<template>
  <div class="client_block">
    <div class="corner top_right"></div>
    <div class="corner top_left"></div>
    <div class="corner bottom_right"></div>
    <div class="corner bottom_left"></div>
    
    <div class="client_block_img">
      <img :src="logo" :alt="name">
    </div>
  </div>
</template>

<script setup lang="ts">
defineProps<{
  name: string;
  logo: string;
}>();
</script>

<style scoped>
/* 使用原网站的样式 */
.client_block {
  width: 20%; /* 5列布局 */
  height: 16.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
  position: relative;
}

/* 顶部黄色线条 (hover时显示) */
.client_block:before {
  content: '';
  display: block;
  width: 0;
  height: 0.3rem;
  background: #e58707;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  transition: 0.7s;
  z-index: 2;
}

.client_block:hover {
  background-color: #232b39;
  box-shadow: 0 4rem 8rem rgba(17, 23, 36, 0.6);
}

.client_block:hover:before {
  width: 100%;
}

.client_block:hover .corner {
  opacity: 0;
}

.client_block:hover img {
  filter: brightness(1.2);
}

/* 四个角的装饰边框 */
.corner {
  position: absolute;
  width: 3rem;
  height: 3rem;
  transition: all 0.3s ease-in-out;
}

.corner.top_right {
  top: 0;
  right: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.corner.top_left {
  top: 0;
  left: -1px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.corner.bottom_right {
  bottom: -1px;
  right: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.corner.bottom_left {
  left: -1px;
  bottom: -1px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* 图标显示 */
.client_block_img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.client_block_img img {
  max-width: 9.7rem;
  max-height: 7.6rem;
  object-fit: contain;
  transition: all 0.3s ease-in-out;
}

/* 响应式设计 */
@media screen and (max-width: 1499px) {
  .client_block {
    height: 10rem;
  }
  
  .client_block_img img {
    max-width: 7rem;
    max-height: 7rem;
  }
}

@media screen and (max-width: 767px) {
  .client_block {
    width: 25%;
  }
}

@media screen and (max-width: 600px) {
  .client_block {
    width: 33.333%;
  }
}

@media screen and (max-width: 420px) {
  .client_block {
    width: 50%;
  }
}
</style>

